//
//  MMPaintingView.h
//  MemeMaker
//
//  Created by Phan Quang Ha on 7/9/13.
//  Copyright (c) 2013 ;. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "MMConstants.h"

@class MMBasicPen;
@class MMMovableImage;
@class MMMovableText;

@protocol MMPaintingViewDelegate <NSObject>

- (void) didChangeWithImage:(UIImage *)img rect:(CGRect)rect isNotification:(BOOL)isNotify;

@end

@interface MMPaintingView : UIView

@property (nonatomic, strong) UIImageView *imgTempPainting;
@property (nonatomic, strong) UIImageView *imgMainPainting;

@property (nonatomic, strong) MMMovableImage *movingImage;
@property (nonatomic, strong) MMMovableText *movingText;

@property (nonatomic, strong) MMBasicPen *currentPen;
@property (nonatomic, assign) id<MMPaintingViewDelegate> delegate;

@property (nonatomic, assign) BOOL canUndo;
@property (nonatomic, assign) DRAWING_STATE dState;

@property (nonatomic, assign) BOOL isErasing;
@property (nonatomic, assign) CGFloat eraserSize;

@property (nonatomic, strong) UIColor *bgColor;

- (UIImage *) getFullImage;

- (void) clear;
- (void) drawPreview;
- (void) increaseHeight:(CGFloat) height;
- (void) beginEditImage:(UIImage *)img;

//add image+text
- (void) drawImage:(UIImage *)img atRect:(CGRect)rect blendMode:(CGBlendMode)blendMode andAlpha:(CGFloat)alpha;
- (void) drawText:(NSString *)text atRect:(CGRect)rect withFont:(UIFont *)font color:(UIColor *)color andTextAlignment:(NSTextAlignment)alignment;
- (void) drawLogImage:(UIImage *)img;

- (void)receivedMovingSubViewWithNotification:(NSNotification *)noti;

@end
